#include "Vector3.h"

namespace uav
{
namespace math
{

const Vector3 Vector3::UnitX = Vector3(Fixed::One,  Fixed::Zero, Fixed::Zero);
const Vector3 Vector3::UnitY = Vector3(Fixed::Zero, Fixed::One,  Fixed::Zero);
const Vector3 Vector3::UnitZ = Vector3(Fixed::Zero, Fixed::Zero, Fixed::One);
const Vector3 Vector3::Zero  = Vector3(Fixed::Zero, Fixed::Zero, Fixed::Zero);

Vector3 Vector3::transform(const Matrix &m, const Vector3 &v)
{
	return Vector3(
		m.m11 * v.x + m.m12 * v.y + m.m13 * v.z,
		m.m21 * v.x + m.m22 * v.y + m.m23 * v.z,
		m.m31 * v.x + m.m32 * v.y + m.m33 * v.z
	);
}

Vector3 Vector3::transformTranspose(const Vector3 &v, const Matrix &m)
{
	return Vector3(
		m.m11 * v.x + m.m21 * v.y + m.m31 * v.z,
		m.m12 * v.x + m.m22 * v.y + m.m32 * v.z,
		m.m13 * v.x + m.m23 * v.y + m.m33 * v.z
	);
}

}}
